<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <script>
//        var Dog = function(){
//            this.name = null;
//            this.height = null;
//            this.age = null;
//            this.eate = function(meat){
//
//                console.log(this.name + '吃' + meat)
//            }
//            this.run = function(){
//
//                console.log(this.name  + '跑')
//            }
//
//        }
//
//        var dog1 = new Dog();
//        dog1.name = 'wangcai';
//        dog1.height = 1.1;
//        dog1.age = 3;
//
//        var dog2 = new Dog();
//        dog1.name = 'wangcai2';
//        dog1.height = 1.21;
//        dog1.age = 32;
//
//        console.log(dog1,dog2)
//
//        dog1.eate('肉')
//        dog1.run()



        var Dog = function(name,height,age){
            this.name = name;
            this.height = height;
            this.age = age;
            this.eate = function(meat){

                console.log(this.name + '吃' + meat)
            }
            this.run = function(){

                console.log(this.name  + '跑')
            }


        }


        var dog1 = new Dog('11',1,2);
        console.log(dog1)

    </script>

</body>
</html>